package com.dlws.modules.productinfo.service;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dlws.modules.productinfo.entity.ProductInfo;
import com.dlws.modules.productinfo.entity.ProductInfoPageVo;
import com.dlws.modules.productinfo.mapper.ProductInfoMapper;
import com.page.Pagination;


@Service
public class ProductInfoServiceImpl implements ProductInfoService{

	@Autowired
	private ProductInfoMapper productInfoMapper; 
	
	
	@Override
	public ProductInfo queryOne(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.selectOne(record);
	}

	@Override
	public List<ProductInfo> queryAll(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.select(record);
	}

	@Override
	public int queryCount(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.selectCount(record);
	}

	@Override
	public ProductInfo queryByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return productInfoMapper.selectByPrimaryKey(key);
	}

	@Override
	public int add(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.insert(record);
	}

	@Override
	public int addSelective(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.insertSelective(record);
	}

	@Override
	public int delete(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.delete(record);
	}

	@Override
	public int deleteByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return productInfoMapper.deleteByPrimaryKey(key);
	}

	@Override
	public int updateByPrimaryKey(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.updateByPrimaryKey(record);
	}

	@Override
	public int updateByPrimaryKeySelective(ProductInfo record) {
		// TODO Auto-generated method stub
		return productInfoMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int queryCountByExample(ProductInfo example) {
		// TODO Auto-generated method stub
		return productInfoMapper.selectCountByExample(example);
	}

	@Override
	public List<ProductInfo> queryByExample(ProductInfo example) {
		// TODO Auto-generated method stub
		return productInfoMapper.selectByExample(example);
	}

	@Override
	public Pagination pagelist(ProductInfoPageVo productInfo) {
		// TODO Auto-generated method stub
		Pagination pagination = new Pagination(productInfo.getPageNo(), productInfo.getPageSize(), pagecount(productInfo));
		pagination.setList(productInfoMapper.pagelist(productInfo));
		return pagination;
	}

	@Override
	public int pagecount(ProductInfoPageVo productInfo) {
		// TODO Auto-generated method stub
		return productInfoMapper.pagecount(productInfo);
	}

}
